package ru.agiledev.aos.core.ws;

import ru.agiledev.aos.core.util.Config;
import ru.agiledev.ws.client.AKBServiceClient;

import java.net.MalformedURLException;
import java.net.URL;

/**
 * Created by a.kirillov
 * Date: 2/6/12 Time: 9:49 PM
 */
public class AKBServiceUtil {
    private static AKBServiceClient client = null;


    public static AKBServiceClient getClient(){
        if(client==null){
            String configURL = Config.getInstance().getAkbWSUrl();
            URL url = null;
            try {
                url = new URL(configURL);
            } catch (MalformedURLException e) {
                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
            }
            client = new AKBServiceClient(url);
        }
        return client;
    }
}
